﻿package idv.cjcat.emitter.behaviors {
	use namespace engine;
	
	import idv.cjcat.emitter.*;
	
	/**
	 * Behavior trigger triggered by particle birth.
	 */
	public class BirthTrigger extends BehaviorTrigger {
		
		override public function test(pd:ParticleData):Boolean {
			if (pd.totalLife == pd.life) return true;
			return false;
		}
		
		
		//XML
		//------------------------------------------------------------------------------------------------
		
		override public function toXML():XML {
			var xml:XML = super.toXML();
			xml.@type = BehaviorTriggerType.BIRTH;
			
			return xml;
		}
		
		//------------------------------------------------------------------------------------------------
		//end of XML
	}
}